<include file="public/layout" />
<!--以下是在线编辑器 代码 -->
<script type="text/javascript">
    /*
	 * 在线编辑器相 关配置 js 
	 *  参考 地址 http://fex.baidu.com/ueditor/
	 */
    window.UEDITOR_Admin_URL = "/public/plugins/Ueditor/";
    var URL_upload = "/index.php/admin/Ueditor/imageUp/savepath/goods.html";
    var URL_fileUp = "/index.php/admin/Ueditor/fileUp/savepath/article.html";
    var URL_scrawlUp = "/index.php/admin/Ueditor/scrawlUp/savepath/article.html";
    var URL_getRemoteImage = "/index.php/admin/Ueditor/getRemoteImage/savepath/article.html";
    var URL_imageManager = "/index.php/admin/Ueditor/imageManager/savepath/article.html";
    var URL_imageUp = "/index.php/admin/Ueditor/imageUp/savepath/article.html";
    var URL_getMovie = "/index.php/admin/Ueditor/getMovie/savepath/article.html";
    var URL_home = "";   
</script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/public/plugins/Ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">  
  
    var editor;
    $(function () {
        //具体参数配置在  editor_config.js  中
        var options = {
            zIndex: 999,
            initialFrameWidth: "95%", //初化宽度
            initialFrameHeight: 400, //初化高度
            focus: false, //初始化时，是否让编辑器获得焦点true或false
            maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign'
            , //允许的最大字符数 'fullscreen',
            pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
            autoHeightEnabled: true
         /*   autotypeset: {
                mergeEmptyline: true,        //合并空行
                removeClass: true,           //去掉冗余的class
                removeEmptyline: false,      //去掉空行
                textAlign: "left",           //段落的排版方式，可以是 left,right,center,justify 去掉这个属性表示不执行排版
                imageBlockLine: 'center',    //图片的浮动方式，独占一行剧中,左右浮动，默认: center,left,right,none 去掉这个属性表示不执行排版
                pasteFilter: false,          //根据规则过滤没事粘贴进来的内容
                clearFontSize: false,        //去掉所有的内嵌字号，使用编辑器默认的字号
                clearFontFamily: false,      //去掉所有的内嵌字体，使用编辑器默认的字体
                removeEmptyNode: false,      //去掉空节点
                                             //可以去掉的标签
                removeTagNames: {"font": 1},
                indent: false,               // 行首缩进
                indentValue: '0em'           //行首缩进的大小
            }*/,
        	toolbars: [
                   ['fullscreen', 'source', '|', 'undo', 'redo',
                       '|', 'bold', 'italic', 'underline', 'fontborder',
                       'strikethrough', 'superscript', 'subscript',
                       'removeformat', 'formatmatch', 'autotypeset',
                       'blockquote', 'pasteplain', '|', 'forecolor',
                       'backcolor', 'insertorderedlist',
                       'insertunorderedlist', 'selectall', 'cleardoc', '|',
                       'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                       'customstyle', 'paragraph', 'fontfamily', 'fontsize',
                       '|', 'directionalityltr', 'directionalityrtl',
                       'indent', '|', 'justifyleft', 'justifycenter',
                       'justifyright', 'justifyjustify', '|', 'touppercase',
                       'tolowercase', '|', 'link', 'unlink', 'anchor', '|',
                       'imagenone', 'imageleft', 'imageright', 'imagecenter',
                       '|', 'insertimage', 'emotion', 'insertvideo',
                       'attachment', 'map', 'gmap', 'insertframe',
                       'insertcode', 'webapp', 'pagebreak', 'template',
                       'background', '|', 'horizontal', 'date', 'time',
                       'spechars', 'wordimage', '|',
                       'inserttable', 'deletetable',
                       'insertparagraphbeforetable', 'insertrow', 'deleterow',
                       'insertcol', 'deletecol', 'mergecells', 'mergeright',
                       'mergedown', 'splittocells', 'splittorows',
                       'splittocols', '|', 'print', 'preview', 'searchreplace']
               ]
        };
        editor = new UE.ui.Editor(options);
        editor.render("content");  //  指定 textarea 的  id 为 goods_content

    }); 
</script>
<!--以上是在线编辑器 代码  end-->
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表"><i class="fa fa-arrow-circle-o-left"></i></a>
            <div class="subject">
                <h3>供应商管理 - 编辑供应商</h3>
                <h5>网站系统供应商管理</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="suppliersHandle" action="{:U('Admin/supplierHandle')}" method="post">
        <input type="hidden" name="act" value="{$act}">
        <input type="hidden" name="suppliers_id" value="{$info.suppliers_id}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="brand_name"><em>*</em>品牌</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="brand_name" value="{$info.brand_name}" id="brand_name" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">品牌</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_name"><em>*</em>厂家名称</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_name" value="{$info.suppliers_name}" id="suppliers_name" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">厂家名称</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_contacts"><em>*</em>厂家联系人</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_contacts" value="{$info.suppliers_contacts}" id="suppliers_contacts" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">厂家联系人</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_phone"><em>*</em>厂家电话</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_phone" value="{$info.suppliers_phone}" id="suppliers_phone" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">厂家电话</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_address"><em>*</em>厂家地址</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_address" value="{$info.suppliers_address}" id="suppliers_address" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">厂家地址</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="admin_id"><em>*</em>产地</label>
                </dt>
                <dd class="opt">
                    <select name="origin_id" id="origin_id">
                    	<option value="0">选择产地</option>
                        <volist name="origin_list" id="item">
                            <option value="{$item.id}" <if condition="$item[id] eq $info[origin_id]"> selected="selected"</if> >{$item.title}</option>
                        </volist>
                    </select>
                    <span class="err"></span>
                    <p class="notic">选择产地</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="type"><em>*</em>类型</label>
                </dt>
                <dd class="opt">
                    <select name="type" id="origin_id">
                    	<option value="0" <if condition="$info[type] eq 0"> selected="selected"</if>>酒</option>
                        <option value="1" <if condition="$info[type] eq 1"> selected="selected"</if>>茶</option>
                    </select>
                    <span class="err"></span>
                    <p class="notic">选择类型</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_aroma"><em>*</em>香型</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_aroma" value="{$info.suppliers_aroma}" id="suppliers_aroma" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请填写香型</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_type"><em>*</em>窖藏方式</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_type" value="{$info.suppliers_type}" id="suppliers_type" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请填写窖藏方式</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="custodian_fee"><em>*</em>窖藏托管单价（元/L/年）</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="custodian_fee" value="{$info.custodian_fee}" id="custodian_fee" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请填写该厂家窖藏托管单价</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">
                    <label for="suppliers_material"><em>*</em>原料</label>
                </dt>
                <dd class="opt">
                    <input type="text" name="suppliers_material" value="{$info.suppliers_material}" id="suppliers_material" class="input-txt">
                    <span class="err"></span>
                    <p class="notic">请填写原料</p>
                </dd>
            </dl>
            <dl class="row">
		        <dt class="tit">酒厂封面图片</dt>
		        <dd class="opt">
		          <div class="input-file-show" id="divComUploadContainer">
		            <span class="show">
		                <a class="nyroModal" rel="gal" href="{$info.suppliers_thumb}">
		                    <i class="fa fa-picture-o" onmouseover="layer.tips('<img src={$info.suppliers_thumb}>',this, {tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
		                </a>
		            </span>           
		            <span class="type-file-box">            
		            <input type="text" id="imagetext" name="suppliers_thumb" value="{$info.suppliers_thumb}" class="type-file-text">            
		            <input type="button" class="type-file-button" onClick="GetUploadify(1,'imagetext','category','')" value="上传图片" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效"/> 
		            </span>
		          </div>
		          <div id="suppliers_thumb" class="ncap-thumb-list">
		            <h5><i class="fa fa-exclamation-circle"></i> 请上传图片格式文件。</h5>
		            <ul>
		            </ul>
		          </div>
		        </dd>
		    </dl> 
		    <dl class="row">
		        <dt class="tit">酒厂LOGO</dt>
		        <dd class="opt">
		          <div class="input-file-show" id="divComUploadContainer">
		            <span class="show">
		                <a class="nyroModal" rel="gal" href="{$info.suppliers_logo}">
		                    <i class="fa fa-picture-o" onmouseover="layer.tips('<img src={$info.suppliers_logo}>',this, {tips: [1, '#fff']});" onmouseout="layer.closeAll();"></i>
		                </a>
		            </span>           
		            <span class="type-file-box">            
		            <input type="text" id="imagetext1" name="suppliers_logo" value="{$info.suppliers_logo}" class="type-file-text">            
		            <input type="button" class="type-file-button" onClick="GetUploadify(1,'imagetext1','category','')" value="上传图片" hidefocus="true" nc_type="change_site_logo" title="点击前方预览图可查看大图，点击按钮选择文件并提交表单后上传生效"/> 
		            </span>
		          </div>
		          <div id="suppliers_logo" class="ncap-thumb-list">
		            <h5><i class="fa fa-exclamation-circle"></i> 请上传图片格式文件。</h5>
		            <ul>
		            </ul>
		          </div>
		        </dd>
		    </dl> 
            <dl class="row">
				<dt class="tit">供应商描述</dt>
				<dd class="opt">          
		            <textarea class="span12 ckeditor" id="content" name="suppliers_desc" title="">
		                {$info.suppliers_desc}
		            </textarea>          
		          <span class="err"></span>
		          <p class="notic">供应商描述</p>
		        </dd>
			</dl>
            <dl class="row">
                <dt class="tit">
                    <label for="admin_id"><em>*</em>所属管理员</label>
                </dt>
                <dd class="opt">
                    <select name="admin_id" id="admin_id">
                        <volist name="admin" id="item">
                            <option value="{$item.admin_id}" <if condition="$item[admin_id] eq $info[admin_id]"> selected="selected"</if> >{$item.user_name}</option>
                        </volist>
                    </select>
                    <span class="err"></span>
                    <p class="notic">所属管理员</p>
                </dd>
            </dl>
            <div class="bot"><a href="JavaScript:void(0);" onclick="adsubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
    </form>
</div>
<script type="text/javascript">
    function adsubmit(){
        if($('input[name=suppliers_name]').val() == ''){
            layer.msg('供应商名称不能为空！', {icon: 2,time: 1000});   //alert('少年，用户名不能为空！');
            return false;
        }
        if($('input[name=suppliers_desc]').val() == ''){
            layer.msg('供应商描述不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');
            return false;
        }
        if($('input[name=suppliers_contacts]').val() == ''){
            layer.msg('供应商联系人不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');
            return false;
        }
        if($('input[name=suppliers_phone]').val() == ''){
            layer.msg('供应商电话不能为空！', {icon: 2,time: 1000});//alert('少年，邮箱不能为空！');
            return false;
        }
        $('#suppliersHandle').submit();
    }
</script>
</body>
